﻿export function init(ele, dotNetHelper, color) {
    $(ele).colorpicker({
        strings: '主题颜色,标准颜色,Web颜色,主题颜色,返回调色板,历史颜色,无历史颜色',
        color,
    });

    $(ele).on('change.color', (event, color) => {
        dotNetHelper.invokeMethodAsync('SetColorAsync', color);
    });
}

export function setColor(ele, color) {
    if (color) {
        $(ele).colorpicker('val', color);
    }
}

export function dispose(ele) {
    $(ele).colorpicker('destroy');
}
